package com.tyun.modules.api.controller;

import com.tyun.common.utils.ResultDTO;
import com.tyun.common.utils.ResultUtil;
import com.tyun.modules.api.annotation.AuthIgnore;
import com.tyun.modules.api.annotation.LoginUser;
import com.tyun.modules.sys.entity.SysUser;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试controller
 *
 * @author tao cong cong
 * @create 2018/2/17 下午10:35
 */
@RestController
@RequestMapping("api")
public class ApiController {

    @GetMapping("userInfo")
    public ResultDTO userInfo(@LoginUser SysUser sysUser){
        return ResultUtil.success("获取user成功",sysUser);
    }

    @AuthIgnore
    @GetMapping("notToken")
    public ResultDTO notToken(){
        return ResultUtil.success("无需token也能访问");
    }

}
